/*
 * @Description:提现记录详情
 * @Author: tao.xie
 * @Date: 2019-03-18 14:05:36
 * @Last Modified by: tao.xie
 * @Last Modified time: 2019-03-19 17:41:46
 */

<template>
  <div
    id="app"
    class="flex-v flex-vc"
  >
    <comsume-detail-main
      :icon-url="detailIcon"
      :detail-msg="detailMsg"
      :info-list="infoList"
    />
  </div>
</template>

<script>
import ConsumeDetailMain from '../components/ConsumeDetailMain'
import { getRefundAndReturnDetail } from '../api/api.js'
import getInfoListDataByState from '../state/CashConsumeStateController.js'
import { RETURN_CASH_CARD_DESTROY, RETURN_CASH_APP_CHARGE } from '../constants/TradeDetailType.js'
export default {
  name: 'App',
  components: {
    'comsume-detail-main': ConsumeDetailMain
  },
  data() {
    return {
      detailIcon: require('../assets/return.png'),
      detailMsg: '提现',
      infoList: []
    }
  },
  mounted() {
    this.getDetail()
  },
  methods: {
    getDetail: async function() {
      try {
        let rs = getRefundAndReturnDetail('201812251527306711236693')
        let associateDetailType = rs.ASSOCIATE_DETAIL_TYPE
        if (associateDetailType === RETURN_CASH_CARD_DESTROY) this.detailMsg = '销卡提现'
        else if (associateDetailType === RETURN_CASH_APP_CHARGE) this.detailMsg = 'APP充值提现'
        this.infoList = getInfoListDataByState(rs)
      } catch (err) { }
    }
  }
}
</script>

<style>
.info {
  margin-top: 20px;
}
</style>
